package net.sunofbeach.blog.controller.portal;

import net.sunofbeach.blog.pojo.NewCommentReply;
import net.sunofbeach.blog.response.ResponseResult;
import net.sunofbeach.blog.services.INewCommentReplyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/portal/NewCommentReply")
public class NewCommentReplyPortalApi {
    @Autowired
    private INewCommentReplyService newCommentReplyService;


    @PostMapping
    public ResponseResult postLy(@RequestBody NewCommentReply newCommentReply) {
        return newCommentReplyService.postNewCommentReply(newCommentReply);
    }

    @GetMapping("/list/{page}/{size}")
    public ResponseResult listComments(@PathVariable("page") int page,
                                       @PathVariable("size") int size) {
        return newCommentReplyService.listNewCommentReply(page, size);
    }

    @GetMapping("/count")
    public ResponseResult getLyCount() {
        return newCommentReplyService.getNewCommentReplyCount();
    }
}
